home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / tool_inc.zip / ITOU.INC < prev    next >
Text File  |  1989-06-02  |  861b  |  39 lines

  1.  
  2. (*
  3.  * Copyright 1987, 1989 Samuel H. Smith;  All rights reserved
  4.  *
  5.  * This is a component of the ProDoor System.
  6.  * Do not distribute modified versions without my permission.
  7.  * Do not remove or alter this notice or any other copyright notice.
  8.  * If you use this in your own program you must distribute source code.
  9.  * Do not use any of this in a commercial product.
  10.  *
  11.  *)
  12.  
  13. (*
  14.  * i_to_ur - converts an unsigned integer into an unsigned real
  15.  *
  16.  *)
  17. function i_to_ur(i: integer): real;  {integer to unsigned-real conversion}
  18. var
  19.    u: word absolute i;
  20. begin
  21.    i_to_ur := u;
  22. end;
  23.  
  24.  
  25. (*
  26.  * ur_to_i - converts an unsigned real into an integer
  27.  *
  28.  *)
  29. function ur_to_i(v: real): integer;  {unsigned-real to integer conversion}
  30. var
  31.    i: integer;
  32.    u: word absolute i;
  33. begin
  34.    u := trunc(v) and $FFFF;
  35.    ur_to_i := i;
  36. end;
  37.  
  38.  
  39.